package com.isoft.data.dao;

import com.isoft.data.xml.Gtls;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface GtlsDao {
    @Insert("INSERT INTO AIRPORT.META(SNDR,RCVR,SEQN,DDTM,TYPE,STYP)" +
            "VALUES(#{gtls.meta.sndr},#{gtls.meta.rcvr},"+
            "#{gtls.meta.seqn},#{gtls.meta.ddtm},"+
            "#{gtls.meta.type},#{gtls.meta.styp})")
    public int addMeta(@Param("gtls") Gtls gtls);
    @Insert("INSERT INTO AIRPORT.GTLS(SEQN,DDTM,FLID,FFID,FIDE,FATT)" +
            "VALUES(#{gtls.meta.seqn},#{gtls.meta.ddtm}," +
            "#{gtls.gtlsDflt.flid},#{gtls.gtlsDflt.ffid}, #{gtls.gtlsDflt.fide}," +
            "#{gtls.gtlsDflt.fatt})")
    public int addGtls(@Param("gtls") Gtls gtls);
    @Insert("INSERT INTO AIRPORT.GTLS_GATE(SEQN,DDTM,GTNO,MID,CODE,GTAT,ESTR,EEND," +
            "RSTR,REND,BTSC)" +
            "VALUES(#{gtls.meta.seqn},#{gtls.meta.ddtm}," +
            "#{gtls.gtlsDflt.gtls.gate.gtno},#{gtls.gtlsDflt.gtls.gate.mid}, #{gtls.gtlsDflt.gtls.gate.code}," +
            "#{gtls.gtlsDflt.gtls.gate.gtat},#{gtls.gtlsDflt.gtls.gate.estr}, #{gtls.gtlsDflt.gtls.gate.eend}," +
            "#{gtls.gtlsDflt.gtls.gate.rstr},#{gtls.gtlsDflt.gtls.gate.rend}, #{gtls.gtlsDflt.gtls.gate.btsc})")
    public int addGtlsGtlsGate(@Param("gtls") Gtls gtls);
}
